package top.zywork.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * 退款申请状态的枚举<br/>
 * 创建于2019-09-03<br/>
 *
 * @author 王振宇
 * @version 1.0
 */
public enum GoodsOrderRefundStatusEnum {

    REFUND_APPLY(0, "已申请"),
    REFUNDING(1, "退款中"),
    REFUND_SUCCESS(2, "退款成功"),
    REFUND_FAIL(3, "退款失败");

    private Integer value;
    private String des;

    public static Map<Integer, GoodsOrderRefundStatusEnum> lookup;

    static {
        lookup = new HashMap<>();
        for (GoodsOrderRefundStatusEnum goodsOrderStatusEnum : EnumSet.allOf(GoodsOrderRefundStatusEnum.class)) {
            lookup.put(goodsOrderStatusEnum.getValue(), goodsOrderStatusEnum);
        }
    }

    GoodsOrderRefundStatusEnum(Integer value, String des) {
        this.value = value;
        this.des = des;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    public static GoodsOrderRefundStatusEnum findByValue(Integer value) {
        return lookup.get(value);
    }

}
